﻿<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Add.aspx.cs" Inherits="WinnerCMS.WebUI.Admin.Special.Add" %>

<%@ Register Src="../UC_AdminSelect.ascx" TagName="UC_AdminSelect" TagPrefix="uc1" %>
<%@ Register Src="../UC_AjaxLoading.ascx" TagName="UC_AjaxLoading" TagPrefix="uc2" %>
<%@ Register TagPrefix="cc1" Namespace="WinnerCMS.WebControls" Assembly="WinnerCMS.WebControls" %>
<!doctype html>
<html>
<head id="Head1" runat="server">
    <title>添加专题</title>
    <meta charset="utf-8">
    <meta content="no-cache" http-equiv="Pragma" />
    <%: Scripts.Render("~/Scripts/AdminBase") %>
    
    
    
    <%: Styles.Render("~/Content/Bootstrap/css") %>

    <script type="text/javascript">
        var HtmlSavePath = '/Article/';
        $(function ()
        {
            $("#tabs").tabs(); 
        });
        function ShowURL()
        {
            var a = $get("txtFilePrefix").value;
            var b = $get("txtFilePostfix").value;
            var index;
            var list = document.getElementById("RBL_URLType").getElementsByTagName("INPUT");

            for (var i = 0; i < list.length; i++)
            {
                if (list[i].checked)
                    index = i;
            }

            if (index == 0)
            {
                $get("show1").innerHTML = "内容页.aspx?ID=内容ID&PageNo=页码";
            }
            if (index == 1)
            {
                $get("show1").innerHTML = HtmlSavePath + "专题ID/" + a + "内容ID_页码" + b;
            }
            if (index == 2)
            {
                $get("show1").innerHTML = HtmlSavePath + "200706/" + a + "内容ID_页码" + b;
            }
            if (index == 3)
            {
                $get("show1").innerHTML = HtmlSavePath + "200706/12/" + a + "内容ID_页码" + b;
            }
        }
        function ShowSpecialURL()
        {
            var a = $get("txtSpecialFilePrefix").value;
            var b = $get("txtSpecialFilePostfix").value;

            var index;
            var list = document.getElementById("RBL_SpecialURLType").getElementsByTagName("INPUT");

            for (var i = 0; i < list.length; i++)
            {
                if (list[i].checked)
                    index = i;
            }

            if (index == 0)
            {
                $get("show2").innerHTML = "内容页.aspx?SpecialID=专题ID&PageNo=页码";
            }
            if (index == 1)
            {
                $get("show2").innerHTML = HtmlSavePath + "专题ID/" + a + "专题ID_页码" + b;
            }
            if (index == 2)
            {
                $get("show2").innerHTML = HtmlSavePath + "专题英文名称/" + a + "专题ID_页码" + b;
            }
        } 
        function OpenGradeRemark()
        {
            var index;
            var list = document.getElementById("RBL_OpenGrade").getElementsByTagName("INPUT");


            for (var i = 0; i < list.length; i++)
            {
                if (list[i].checked)
                {
                    index = i;
                }
            }

            if (index == 0)
            {
                $get("show3").innerHTML = "游客可以看到该专题拥有的内容，遇到有权限的内容由内容页进去处理。";
            }
            if (index == 1)
            {
                $get("show3").innerHTML = "游客是看不到含有权限内容的链接，仅能看见免费的内容。";
            }
            if (index == 2)
            {
                $get("show3").innerHTML = "全面禁止游客看到任何内容。";
            }
        } 
        function GetTemplate(ControlName)
        {
            $("#dialog-modal").dialog({
                height: 450,
                width: 500,
                title: "网页模板",
                modal: true
            });
            var urlC = $("#dialog-modal-url");
            urlC.attr("src", "../window/GetTemplate.aspx?Control=" + ControlName);
            urlC.width(460);
            urlC.height(410);
        }
 
    </script>
    <style type="text/css">
        .input-append
        {
            font-size: 1em;
        }
    </style>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server">
    </asp:ScriptManager>
    <div id="tabs">
        <ul>
            <li ><a href="#Tab0"><span>基本属性</span></a></li>
            <li ><a href="#Tab1"><span>权限设置</span></a></li>
            <li ><a href="#Tab2"><span>URL样式</span></a></li>
            <li ><a href="#Tab3"><span>其他属性</span></a></li>
            <li ><a href="#Tab4"><span>扩展属性</span></a></li>
        </ul>
    
    <table id="Tab0" class="TabelGrid" style="width: 100%">
        <tr>
            <td class="RowTitle">
                所属专题：
            </td>
            <td>
                <asp:DropDownList ID="ddlSpecial" runat="server" AutoPostBack="True" 
                    onselectedindexchanged="ddlSpecial_SelectedIndexChanged">
                </asp:DropDownList>
            </td>
        </tr>
        <tr>
            <td class="RowTitle">
                绑定模型：</td>
            <td>
                <asp:DropDownList ID="ddlModel" runat="server">
                </asp:DropDownList>
            </td>
        </tr>
        <tr>
            <td class="RowTitle">
                专题名称：
            </td>
            <td>
                <asp:TextBox ID="txtSpecialName" runat="server"></asp:TextBox>
                <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ControlToValidate="txtSpecialName"
                    ErrorMessage="请输入专题名称"></asp:RequiredFieldValidator>
            </td>
        </tr>
        <tr>
            <td class="RowTitle">
                专题英文名称：
            </td>
            <td>
                <asp:TextBox ID="txtSpecialName_EN" runat="server"></asp:TextBox>
                <br />
                不填写亦可，如果选择了用英文名称作生成HTML规则就会被用到
            </td>
        </tr>
        <tr>
            <td class="RowTitle">
                专题模板：
            </td>
            <td><div>
                <asp:TextBox ID="txtTemplateFileName" runat="server" Width="250px"></asp:TextBox>
                <input class="btn btn-default" type="button" onclick="GetTemplate('txtTemplateFileName');" value="网页模板" /></div>
            </td>
        </tr>
        <tr>
            <td class="RowTitle">
                内容页模板：</td>
            <td><div>
                <asp:TextBox ID="txtShowPageTemplateFileName" runat="server" Width="250px"></asp:TextBox>
                <input class="btn btn-default" type="button" onclick="GetTemplate('txtShowPageTemplateFileName');" value="网页模板" /></div></td>
        </tr>
        <tr>
            <td class="RowTitle">
                专题链接地址：
            </td>
            <td>
                <asp:TextBox ID="txtLinkUrl" runat="server" Width="341px"></asp:TextBox>
                <span class="help-block">
                如果想将专题链接到外部地址，请输入完整的URL地址，否则请保持为空。</span>
            </td>
        </tr>
    </table>
    <table id="Tab1" class="TabelGrid" style="width: 100%">
        <tr>
            <td class="RowTitle">
                内容管理员：
            </td>
            <td>
                <asp:HiddenField ID="hfContentAdmin" runat="server" />
                <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                    <ContentTemplate>
                        <uc1:UC_AdminSelect ID="UC_AdminSelect1" runat="server" Visible="true"></uc1:UC_AdminSelect>
                    </ContentTemplate>
                </asp:UpdatePanel>
            </td>
        </tr>
        <tr>
            <td class="RowTitle">
                专题管理员：
            </td>
            <td>
                <asp:HiddenField ID="hfSpecialAdmin" runat="server" />
                <asp:UpdatePanel ID="UpdatePanel2" runat="server">
                    <ContentTemplate>
                        <uc1:UC_AdminSelect ID="UC_AdminSelect2" runat="server" />
                    </ContentTemplate>
                </asp:UpdatePanel>
            </td>
        </tr>
        <tr>
            <td class="RowTitle">
                开放专题设置：
            </td>
            <td>
                <asp:RadioButtonList ID="RBL_OpenGrade" runat="server" RepeatColumns="3" RepeatDirection="Horizontal"
                    onclick="OpenGradeRemark();" CssSpecial="icheckboxStyle">
                    <asp:ListItem Value="1" Selected="True">开放专题</asp:ListItem>
                    <asp:ListItem Value="2">对游客隐藏权限内容</asp:ListItem>
                    <asp:ListItem Value="3">认证专题</asp:ListItem>
                </asp:RadioButtonList>
                说明：<span id="show3"></span>
            </td>
        </tr>
    </table>
    <table id="Tab2" class="TabelGrid" style="width: 100%">
        <tr>
            <td class="RowTitle">
                内容页静态文件扩展名：
            </td>
            <td>
                <asp:TextBox ID="txtFilePostfix" runat="server">.html</asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="RowTitle">
                内容页静态文件前缀：
            </td>
            <td>
                <asp:TextBox ID="txtFilePrefix" runat="server"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="RowTitle">
                内容页生成规则：
            </td>
            <td>
                <asp:RadioButtonList ID="RBL_URLType" runat="server" RepeatDirection="Horizontal"
                    onclick="ShowURL();" CssSpecial="icheckboxStyle">
                    <asp:ListItem Value="0" Selected="True">动态</asp:ListItem>
                    <asp:ListItem Value="1">静态规则一</asp:ListItem>
                    <asp:ListItem Value="2">静态规则二</asp:ListItem>
                    <asp:ListItem Value="3">静态规则三</asp:ListItem>
                </asp:RadioButtonList>
                样式预览：<span id="show1"></span>
            </td>
        </tr>
        <tr>
            <td class="RowTitle">
                专题静态页扩展名：
            </td>
            <td>
                <asp:TextBox ID="txtSpecialFilePostfix" runat="server" ToolTip=".html">.html</asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="RowTitle">
                专题静态页前缀：
            </td>
            <td>
                <asp:TextBox ID="txtSpecialFilePrefix" runat="server"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="RowTitle">
                专题页生成规则：
            </td>
            <td>
                <asp:RadioButtonList ID="RBL_SpecialURLType" runat="server" RepeatDirection="Horizontal"
                    onclick="ShowSpecialURL();" CssSpecial="icheckboxStyle">
                    <asp:ListItem Value="0" Selected="True">动态</asp:ListItem>
                    <asp:ListItem Value="1">静态规则一</asp:ListItem>
                    <asp:ListItem Value="2">静态规则二</asp:ListItem>
                </asp:RadioButtonList>
                样式预览：<span id="show2"></span>
            </td>
        </tr>
    </table>
    <table id="Tab3" class="TabelGrid" style="width: 100%">
        <tr>
            <td class="RowTitle">
                专题介绍<br />
                <span style="font-weight: normal">支持HTML</span>
            </td>
            <td>
                <asp:TextBox ID="txtSpecialIntro" runat="server" Height="80px" TextMode="MultiLine"
                    Width="300px"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="RowTitle">
                专题缩略图
            </td>
            <td>
                <asp:TextBox ID="txtSpecialPic" runat="server" Height="80px" TextMode="MultiLine" Width="300px"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="RowTitle">
                专题META网页描述
            </td>
            <td>
                <asp:TextBox ID="txtSpecialDescription" runat="server" Height="80px" TextMode="MultiLine"
                    Width="300px"></asp:TextBox>
            </td>
        </tr>
        <tr>
            <td class="RowTitle">
                专题META关键词
            </td>
            <td>
                <asp:TextBox ID="txtSpecialKeyWord" runat="server" Height="80px" Width="300px" TextMode="MultiLine"></asp:TextBox>
            </td>
        </tr>
    </table>
    <asp:UpdatePanel ID="UpdatePanel3" runat="server">
        <ContentTemplate>
            <table id="Tab4" class="TabelGrid" style="width: 100%">
                <tr>
                    <td class="RowTitle">
                        拷贝其他类别属性：
                    </td>
                    <td>
                        <asp:DropDownList ID="ddlCopySpecial" runat="server" AutoPostBack="True" OnSelectedIndexChanged="ddlCopySpecial_SelectedIndexChanged">
                        </asp:DropDownList>
                    </td>
                </tr>
                <tr>
                    <td class="RowTitle">
                        扩展属性：
                    </td>
                    <td>
                        <asp:CheckBoxList ID="CBL_Fields" runat="server" RepeatColumns="5" RepeatDirection="Horizontal">
                        </asp:CheckBoxList>
                    </td>
                </tr>
            </table>
        </ContentTemplate>
    </asp:UpdatePanel></div>
    <br />
    <div style="text-align: center">
        <asp:Button ID="btnOK" runat="server" Text="添加" OnClick="btnOK_Click" CssSpecial="btn">
        </asp:Button>
    </div>
    <div id="dialog-modal">
        <iframe id="dialog-modal-url" frameborder="0" scrolling="no"></iframe>
    </div>
    <script type="text/javascript" language="javascript">        ShowURL(); ShowSpecialURL();</script>

    </form>
</body>
</html>